import request from './request.js'
const accountInfo = uni.getAccountInfoSync()
const appId = accountInfo.miniProgram.appId;

// 获取培训列表
function tainList(params) {
	return request({
		url: `/systemj/information/applets/trainsList`,
		method: 'get',
		params: params
	})
}

// 查看培训项目
function trainParticulars(params) {
	return request({
		url: '/systemj/information/getTrainDetails',
		method: 'get',
		params: params
	})
}

// 查看培训项目
function trainProjectList(params) {
	return request({
		url: '/systemj/information/projectList',
		method: 'get',
		params: params
	})
}

// 查看报名费用（未支付前）
function searchTrainCost(params) {
	return request({
		url: '/systemj/signer/getEnrollBill',
		method: 'get',
		params: params
	})
}

// 提交 用户资料
function trainNext(params) {
	return request({
		url: `/systemj/signer/signUp`,
		method: 'post',
		params,
	})
}

// 生成订单
function createOrder(params) {
	return request({
		url: `/systemj/order/saveOrder`,
		method: 'post',
		params,
	})
}

//会员支付
function pay(params) {
	return request({
		url: `/systemj/order/pay`,
		method: 'post',
		params,
	})
}

// 线下支付银行信息
function bankSlip(params) {
	return request({
		url: `/systemj/order/bankInfo`,
		method: 'get',
		params,
	})
}

function trainOrder(params) {
	return request({
		url: `/systemj/order/getMyOrders`,
		method: 'get',
		params,
	})
}

// 修改报名
function trainUpdata(params) {
	return request({
		url: `/systemj/signer/updateSign`,
		method: 'put',
		params,
	})
}

// 取消订单
function cancelOrder(params) {
	return request({
		url: `/systemj/order/cancelOrder`,
		method: 'put',
		params,
	})
}

// 报项列表
function signList(params) {
	return request({
		url: `/systemj/signer/applets/signList`,
		method: 'get',
		params,
	})
}

// 报项详情
function signDetail(params) {
	return request({
		url: `/systemj/signer/applets/signDetail`,
		method: 'get',
		params,
	})
}

// 订单列表
function orderList(params) {
	return request({
		url: `/systemj/order/applets/orderList`,
		method: 'get',
		params,
	})
}


// 订单详情
function getOrderDetail(params) {
	return request({
		url: `/systemj/order/getOrderDetail`,
		method: 'get',
		params,
	})
}



export {
	getOrderDetail,
	orderList,
	signDetail,
	signList,
	tainList,
	trainParticulars,
	trainProjectList,
	searchTrainCost,
	trainNext,
	createOrder,
	pay,
	bankSlip,
	trainOrder,
	trainUpdata,
	cancelOrder
}